
# （1）导入selenium
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.service import Service

# (2) 创建浏览器操作对象
# 自动下载匹配的ChromeDriver
service = Service(ChromeDriverManager().install())
browser = webdriver.Chrome(service=service)


# （3）访问网站
url = 'https://www.baidu.com'
#
# browser.get(url)

# url = 'https://www.jd.com/'

browser.get(url)

# page_source获取网页源码
# content = browser.page_source
# print(content)

button = browser.find_element('id', 'chat-submit-button');

print(button.text)
